home *** CD-ROM | disk | FTP | other *** search
- on enterFrame
- global NewScreenID, BaseChannel, LastChannel, NumChannel, OverChannel, GfxChannel, SeqChannel, DVidChannel, CurtainChannel, first, CurrScreenID, AllScreen, offList, rollList, clickList, ActList, ScreenCast, ScreenLinks, NumActive, NumChannels, cenX, cenY, StickH, StickV
- if NewScreenID then
- set CurrScreenID to NewScreenID
- if first then
- set first to 0
- repeat with J = BaseChannel to LastChannel
- puppetSprite(J, 1)
- end repeat
- puppetSprite(31, 1)
- puppetSprite(OverChannel, 1)
- puppetSprite(OverChannel + 1, 1)
- puppetSprite(GfxChannel, 1)
- puppetSprite(SeqChannel, 1)
- puppetSprite(DVidChannel, 1)
- puppetSprite(CurtainChannel, 1)
- end if
- set ScreenInfo to getAt(AllScreen, NewScreenID)
- set ChangePalette to 0
- if ScreenCast <> -1 then
- set PalA to the palette of cast ScreenCast
- else
- set ChangePalette to 1
- end if
- set ScreenCast to getAt(ScreenInfo, 1)
- if ScreenCast <> -1 then
- set PalB to the palette of cast ScreenCast
- end if
- if PalA <> PalB then
- set ChangePalette to 1
- end if
- if ChangePalette then
- puppetPalette("Black", 27)
- end if
- puppetSprite(BaseChannel, 1)
- set the castNum of sprite BaseChannel to ScreenCast
- puppetSprite(48, 1)
- set the castNum of sprite 48 to 15
- puppetSprite(CurtainChannel, 1)
- set the castNum of sprite CurtainChannel to ScreenCast
- if ChangePalette then
- updateStage()
- puppetPalette(PalB, 27)
- end if
- set ScreenLinks to [getAt(ScreenInfo, 2)]
- append(ScreenLinks, getAt(ScreenInfo, 3))
- append(ScreenLinks, getAt(ScreenInfo, 4))
- NavSprites(ScreenLinks)
- set offList to []
- set rollList to []
- set clickList to []
- set ActList to []
- set CurrChannel to BaseChannel + 1
- set NumActive to 0
- repeat with Element in ScreenInfo
- if listp(Element) then
- set NumActive to NumActive + 1
- put "Element = " & Element
- append(offList, getAt(Element, 1))
- set ActID to count(Element)
- if ActID = 2 then
- set RollID to 1
- set ClickID to 1
- else
- if ActID = 3 then
- set RollID to 2
- set ClickID to 2
- else
- if ActID = 4 then
- set RollID to 2
- set ClickID to 3
- end if
- end if
- end if
- append(rollList, getAt(Element, RollID))
- append(clickList, getAt(Element, ClickID))
- append(ActList, getAt(Element, ActID))
- puppetSprite(CurrChannel, 1)
- put "setting " & CurrChannel & " to " & getAt(Element, 1)
- set the castNum of sprite CurrChannel to getAt(Element, 1)
- set CurrChannel to CurrChannel + 1
- end if
- end repeat
- repeat with J = NumActive + 1 to NumChannels - 1
- puppetSprite(CurrChannel, 1)
- set the castNum of sprite CurrChannel to 3
- set the locH of sprite CurrChannel to 320
- set the locV of sprite CurrChannel to 240
- set CurrChannel to CurrChannel + 1
- end repeat
- ResetRoll()
- resetGfx()
- resetSeq()
- resetVideo()
- if ScreenCast = 107 then
- set the moveableSprite of sprite LastChannel to 1
- puppetSprite(5, 1)
- set the castNum of sprite 5 to 701
- set cenX to 315
- set cenY to 260
- repeat with k = LastChannel down to LastChannel - 9
- set the castNum of sprite k to 91 + (k - LastChannel + 9)
- set f to (k - LastChannel + 9) / 10.0
- set dx to 320 - cenX
- set dy to 240 - cenY
- set the locH of sprite k to cenX + (f * dx)
- set the locV of sprite k to cenY + (f * dy)
- end repeat
- else
- set the moveableSprite of sprite LastChannel to 0
- set the castNum of sprite 5 to 3
- end if
- set the castNum of sprite 48 to 3
- set the castNum of sprite CurtainChannel to 3
- set StickH to 180
- set StickV to 120
- end if
- end
-
- on exitFrame
- global CurrScreenID, offList, AddScreeb, BaseChannel, bDrag, bDragging, NumActive, EndChannel, NumChannels, Issue, OverChannel, NewScreenID, ScreenCast, LastChannel, cenX, cenY, StickH, StickV
- set c to the mouseCast
- if NewScreenID then
- set NewScreenID to 0
- set the castNum of sprite 31 to 211
- set the visible of sprite 31 to CurrScreenID = 7
- end if
- if (c < 5) or (c > 7) or bDragging then
- set ActiveChannel to 0
- set StdCursor to 1
- set rollAt to getPos(rollList, c)
- if not bDragging then
- set the castNum of sprite (OverChannel + 1) to 3
- if rollAt then
- set ActiveChannel to rollAt + BaseChannel
- if soundBusy(2) then
- go(the frame)
- exit
- end if
- if the mouseDown and not bDrag then
- cursor(200)
- set the castNum of sprite OverChannel to getAt(clickList, rollAt)
- updateStage()
- repeat while the mouseDown
- end repeat
- cursor(0)
- decode(getAt(ActList, rollAt))
- end if
- else
- set offAt to getPos(offList, c)
- if offAt then
- set ActiveChannel to offAt + BaseChannel
- put "Sprite = " & ActiveChannel & " change to cast " & getAt(rollList, offAt)
- puppetSprite(ActiveChannel, 1)
- set the castNum of sprite OverChannel to getAt(rollList, offAt)
- end if
- end if
- if ActiveChannel then
- set StdCursor to 0
- cursor([28, 29])
- else
- if not bDrag then
- ResetHighChannels()
- end if
- end if
- else
- set expert to the mouseCast - 244
- repeat with J = 0 to 3
- set the castNum of sprite (14 + J) to 244 + (J * 2)
- end repeat
- if (expert >= 0) and (expert <= 7) then
- put "Mousecast on drag expert " & expert
- set the castNum of sprite (14 + (expert / 2)) to expert + 245
- end if
- end if
- if bDragging then
- cursor([38, 39])
- set StdCursor to 0
- if the mouseUp then
- set ComExpert to expert
- set expert to 1 + (expert / 2)
- set CastDo to ((Issue - 1) * 4) + (expert - 1)
- if (expert >= 1) and (expert <= 4) then
- set CastDo to 501 + CastDo
- put "Issue = " & Issue & " put to expert " & expert & " play cast " & CastDo
- playVideo(CastDo, 329, 237)
- set comCastBack to (ComExpert / 2 * 2) + 244
- set the castNum of sprite (14 + (ComExpert / 2)) to comCastBack
- put "Cast back to " & comCastBack
- else
- put "That's not an expert"
- end if
- end if
- end if
- if not bDragging then
- set bDrag to 0
- if (c = 232) or ((c >= 301) and (c <= 304)) then
- set bDrag to 1
- set k to 3.60000000000000009 * (the mouseV - the top of the rect of cast 232) / (1.0 * the height of cast 232)
- set currline to 301 + integer(k)
- if currline > 304 then
- set currline to 304
- end if
- set the castNum of sprite (OverChannel + 1) to currline
- set Issue to currline - 300
- if Issue > 4 then
- set Issue to 4
- end if
- put "Issue = " & Issue
- else
- if (c = 237) or ((c >= 311) and (c <= 315)) then
- set bDrag to 1
- set k to 4.20000000000000018 * (the mouseV - the top of the rect of cast 237) / (1.0 * the height of cast 237)
- set currline to 311 + integer(k)
- set the castNum of sprite (OverChannel + 1) to currline
- set Issue to currline - 306
- if Issue > 9 then
- set Issue to 9
- end if
- put "Issue = " & Issue
- end if
- end if
- if bDrag then
- cursor([28, 29])
- set StdCursor to 0
- end if
- end if
- if bDrag and the mouseDown then
- if (Issue = 1) or (Issue = 5) then
- if Issue = 1 then
- nothing()
- set helpCast to 256
- else
- if Issue = 5 then
- nothing()
- set helpCast to 259
- end if
- end if
- ResetHighChannels()
- set the castNum of sprite OverChannel to helpCast
- updateStage()
- repeat while the mouseDown
- end repeat
- else
- set bDragging to 1
- end if
- else
- set bDragging to 0
- end if
- if StdCursor then
- cursor(0)
- end if
- else
- if c = 7 then
- cursor([22, 23])
- if the mouseDown then
- set NewScreenID to getAt(ScreenLinks, 3)
- end if
- else
- if c = 5 then
- cursor([20, 21])
- if the mouseDown then
- set NewScreenID to getAt(ScreenLinks, 1)
- end if
- else
- cursor([24, 25])
- if the mouseDown then
- set NewScreenID to getAt(ScreenLinks, 2)
- end if
- end if
- end if
- ResetHighChannels()
- end if
- if ScreenCast = 107 then
- set sweep to 20
- if the locH of sprite LastChannel < (320 - sweep) then
- set the locH of sprite LastChannel to 320 - sweep
- else
- if the locH of sprite LastChannel > (320 + sweep) then
- set the locH of sprite LastChannel to 320 + sweep
- end if
- end if
- if the locV of sprite LastChannel < (240 - sweep) then
- set the locV of sprite LastChannel to 240 - sweep
- else
- if the locV of sprite LastChannel > (240 + sweep) then
- set the locV of sprite LastChannel to 240 + sweep
- end if
- end if
- set dx to the locH of sprite LastChannel - 320
- set dy to the locV of sprite LastChannel - 240
- set vX to the locH of sprite LastChannel - cenX
- set vY to the locV of sprite LastChannel - cenY
- if the mouseDown then
- if c = 100 then
- set the locH of sprite LastChannel to the mouseH - StickH
- set the locV of sprite LastChannel to the mouseV - StickV
- end if
- repeat with k = 0 to 9
- set f to k / 10.0
- set the locH of sprite (LastChannel - 9 + k) to cenX + (f * vX)
- set the locV of sprite (LastChannel - 9 + k) to cenY + (f * vY)
- end repeat
- else
- end if
- set the locH of sprite 5 to the locH of sprite 5 - (dx / 2)
- set the locV of sprite 5 to the locV of sprite 5 - (dy / 2)
- set limitL to 217
- set limitR to 681
- set limitT to 21
- set limitB to 398
- if the locH of sprite 5 < limitL then
- set the locH of sprite 5 to limitL
- end if
- if the locH of sprite 5 > limitR then
- set the locH of sprite 5 to limitR
- end if
- if the locV of sprite 5 < limitT then
- set the locV of sprite 5 to limitT
- end if
- if the locV of sprite 5 > limitB then
- set the locV of sprite 5 to limitB
- end if
- end if
- if NewScreenID then
- put "Going to " & NewScreenID
- repeat while the mouseDown
- end repeat
- end if
- go(the frame)
- end
-
- on ResetHighChannels
- global OverChannel
- set the castNum of sprite OverChannel to 3
- set the castNum of sprite (OverChannel + 1) to 3
- end
-
- on NavSprites ScreenLinks
- repeat with J = 1 to 3
- set ch to 44 + J
- puppetSprite(ch, 1)
- if getAt(ScreenLinks, J) then
- set the visible of sprite ch to 1
- next repeat
- end if
- set the visible of sprite ch to 0
- end repeat
- end
-